﻿<Window x:Class="Coding4Fun.PrinterDisplayHack.FindPrinters"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		Background="{DynamicResource WindowBackgroundBrush}"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="Find Printers" Height="320" Width="480" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow">
    <Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="30" />
			<RowDefinition Height="*" />
			<RowDefinition Height="40" />
			<RowDefinition Height="40" />
		</Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="0,0,0,0">
        	<Label Margin="10,4,0,0" VerticalAlignment="Top" Width="142" HorizontalAlignment="Left" FontSize="14.667" FontWeight="Bold" Content="Select a printer"/>
        </StackPanel>
		<DockPanel Grid.Row="1" >
			<ListView ItemsSource="{Binding Printers}" Margin="5" SelectionChanged="ListView_SelectionChanged" MouseDoubleClick="ListView_MouseDoubleClick">
				<ListView.View>
					<GridView>
						<GridViewColumn Header="Printer name" DisplayMemberBinding="{Binding Name}" />
						<GridViewColumn Header="Address" DisplayMemberBinding="{Binding Address}" />
					</GridView>
				</ListView.View>
			</ListView>
		</DockPanel>
		<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top">
			<Button x:Name="btnRefresh" Width="160" Content="Search Again" Margin="0 0 5 0" Click="btnRefresh_Click" />
		</StackPanel>
		<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
			<Button x:Name="btnSelect" Width="80" Content="Select" Margin="0 0 5 0" IsEnabled="False" Click="btnSelect_Click" IsDefault="True" />
			<Button x:Name="btnCancel" Width="80" Content="Cancel" Margin="5,0" Click="btnCancel_Click" IsCancel="True" />
		</StackPanel>
    </Grid>
</Window>
